<?php
/**
 * The activate file of mailto plugin.
 *
 * @copyright   Copyright 2013-2015 黄小标 (Xiaobiao Studio,Chongqing. )
 * @license     
 * @author      Xiaobiao Huang <huangxb0512@gmail.com>
 * @package     mailto
 * @version     $Id: mailto.class.php  2013-05-19 12:00:14 huangxb0512@gmail.com 
 * @link        
 */
?>
<?php
class mailtoUser extends userModel
{
	public function getPairs($params = '')
	{
		$users = parent::getPairs($params);
		if (strpos($params, 'mailto') !== false)
		{
			$fields = 'account, realname';
			$users = $this->dao->select($fields)->from(TABLE_USER)
            ->beginIF(strpos($params, 'nodeleted') !== false)->where('deleted')->eq(0)->fi()
            ->orderBy('account')
            ->fetchAll('account');
			foreach($users as $realname => $user)
			{
				//foreach ($user as $key => $value)
				$users[$user->realname] =  $user->account;
				$users[$user->account] =  $user->account;
			}
		}
		return $users;
	}
}
?>
